<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of articles
 *
 * @author IT
 */
class articles extends connection{
    function laynoidung(){
        $page = 1;
        if(isset($_GET['page'])){
        $page = $_GET['page']; 
        }
        $query = "SELECT * FROM articles LIMIT ".(($page-1)*2).',2';
        $data = $this->laydulieu($query);
        return $data;
    }
    function view_more(){
        $view = $_GET['view'];
        $query = "SELECT * FROM articles WHERE id = ".$view;
        $data = $this->laydulieu($query);
        return $data;
    }
    function view_cate(){
        $cate = $_GET['cate'];
        $query = "SELECT * FROM articles WHERE id_category = ".$cate;
        $data = $this->laydulieu($query);
        return $data;
    }
    function view_all(){
        $query = "SELECT * FROM articles ";
        $data = $this->laydulieu($query);
        return $data;
    }
}
